import axios from './index'

const preUrl = 'version'


// 月份版本修改数
const getMonthCount = {
  p: [`get,version/projectname`],
  r: params => {
    return axios.get(`${preUrl}/${Cookie.get('areaId')}/projectname`, {
      params
    })
  }
}

// 月份版本修改数
const getYearCount = {
  p: [`get,version/total`],
  r: params => {
    return axios.get(`${preUrl}/${Cookie.get('areaId')}/total`, {
      params
    })
  }
}

// 获取当月每天列表
const getDayList = {
  p: [`get,version/list`],
  r: params => {
    return axios.get(`${preUrl}/${Cookie.get('areaId')}/list`, {
      params
    })
  }
}

// 获取版本详情
const getVersionDetails = {
  p: [`get,version/info/*`],
  r: params => {
    return axios.get(`${preUrl}/info/${params.id}`)
  }
}

// 回滚版本详情
const rollbackVersion = {
  p: [`put,version/rollback`],
  r: params => {
    return axios.put(`${preUrl}/rollback`, params)
  }
}


export {
  getMonthCount,
  getYearCount,
  getDayList,
  getVersionDetails,
  rollbackVersion
}